Contextual query revision

ABSTRACT

Apparatus, systems and methods for contextual query revision are disclosed. A current search query is received during a search session. The current search query includes one or more current search tokens. Potentially inaccurate search tokens are identified from the one or more current search tokens. A possible replacement token is identified based upon the potentially inaccurate search token. A group of related tokens is identified from query logs, and a modified search query is generated if the replacement token is not included in the related tokens.

CROSS-REFERENCE TO RELATED APPLICATION

This application is a continuation of U.S. application Ser. No.14/097,887, titled “CONTEXTUAL QUERY REVISION” filed Dec. 5, 2013, whichis a continuation of U.S. application Ser. No. 13/109,308, titled“CONTEXTUAL QUERY REVISION” filed May 17, 2011, now U.S. Pat. No.8,626,785, which is a continuation of U.S. application Ser. No.11/952,770, titled “CONTEXTUAL QUERY REVISION” filed May 7, 2007, nowU.S. Pat. No. 7,953,746. The entire contents of each of the foregoingapplications are incorporated herein by reference

BACKGROUND

This document relates to contextual query revision.

The rise of the Internet has enabled access to a wide variety of contentitems, e.g., video and/or audio files, web pages for particularsubjects, news articles, etc. Content items of particular interest to auser can be identified by a search engine in response to a user query.One example search engine is the Google search engine provided by GoogleInc. of Mountain View, Calif., U.S.A. The query can include one or moresearch terms or phrases, and the search engine can identify and,optionally, rank the content items based on the search terms or phrasesin the query and present the content items to the user (e.g., in orderaccording to the rank).

Search queries sometimes contain inaccurate or incorrectly typed termsthat cause results to be returned that are not of interest to the user.Accordingly, users may have to modify their queries one or more times toreplace inaccurate search terms until the search engine returns theresults that are of interest to the user. Some search engines, however,can automatically correct or suggest corrections to inaccurate orincorrectly typed terms; however, these suggestions may not enhance theuser experience, as the suggestions may include further inaccurate termsthat are not pertinent to the user's current interests.

SUMMARY

In general, one aspect of the subject matter disclosed in thisspecification can be embodied in a method for contextual query revision.The method includes receiving a current search query during a searchsession, the current search query comprising one or more current searchtokens; identifying a potentially inaccurate search token from the oneor more current search tokens; identifying a possible replacement tokenbased upon the potentially inaccurate search token; identifying relatedtokens from a query log based upon previous search queries associatedwith the search session; determining whether the possible replacementtoken for the potentially inaccurate search token is included in thegroup of related tokens; and in response to determining that thepossible replacement token is among the group of related tokens,generating a modified search query that includes the possiblereplacement token. Other embodiments of this aspect includecorresponding systems, apparatus, and computer program products.

In another aspect, another method for contextual query revision includesreceiving a current search query associated with a search session;identifying a potentially inaccurate search token in the current searchquery; identifying related tokens from a query log based upon previoussearch queries associated with the search session; comparing thepotentially inaccurate search token to the related tokens to determinewhether the potentially inaccurate search token is included in therelated tokens; if the potentially inaccurate search token is notincluded in the related tokens, identifying a replacement token from therelated tokens; and substituting the potentially inaccurate search tokenin the current search query with the replacement token. Otherembodiments of this aspect include corresponding systems, apparatus, andcomputer program products.

Various optional advantages and features can include the identificationof potentially incorrect search tokens based on a search sessioncontext. A replacement token can be substituted for the potentiallyinaccurate search token based on the search session context. Suchcontextual identification of potentially inaccurate search tokens andcontextual revision of the search query can generate modified searchqueries that are directed to the user's current interest, thus improvingthe user experience.

The details of one or more embodiments of the subject matter describedin this specification are set forth in the accompanying drawings and thedescription below. Other features, aspects, and advantages of thesubject matter will become apparent from the description, the drawings,and the claims.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 is a block diagram of an example online environment.

FIG. 2 is a block diagram of an example contextual query processingsystem.

FIG. 3 is a diagram identifying related tokens from previous searchqueries.

FIG. 4 depicts example screen shots of a search engine interface.

FIG. 5 is a flow diagram of a contextual query revision process.

FIG. 6 is a flow diagram of another contextual query revision process.

Like reference numbers and designations in the various drawings indicatelike elements.

DETAILED DESCRIPTION

FIG. 1 is a block diagram of an example online environment 100. Theonline environment 100 can facilitate the identification and serving ofcontent items, e.g., web pages, advertisements, etc., to users. Acomputer network 110, such as a local area network (LAN), wide areanetwork (WAN), the Internet, or a combination thereof, connectsadvertisers 102 a and 102 b, a search engine 112, publishers 106 a and106 b, and user devices 108 a and 108 b. Example user devices 108include personal computers, mobile communication devices, televisionset-top boxes, etc. Although only two advertisers (102 a and 102 b), twopublishers (106 a and 106 b) and two user devices (108 a and 108 b) areshown, the online environment 100 may include many thousands ofadvertisers, publishers and user devices.

§1.0 Content Search Processing

The publishers 106 a and 106 b can include general content servers thatreceive requests for content (e.g., web pages or documents related toarticles, discussion threads, music, video, graphics, other web pagelistings, information feeds, product reviews, etc.), and retrieve therequested content in response to the request. For example, contentservers related to news content providers, retailers, independent blogs,social network sites, products for sale, or any other entity thatprovides content over the network 110 can be a publisher.

A user device, such as user device 108 a, can submit a query 109 to thesearch engine 112, and search results 111 can be provided to the userdevice 108 a in response to the query 109. The search results 111 caninclude a link to web pages provided by the publishers 106 a and 106 b.

In some implementations, the query 109 can include one or more searchtokens. A search token is a keyword or group of keywords submitted aspart of a search query through a search engine that are used to retrieveresponsive search results. For example, a user can search for aparticular type of yellow flower with a long stem. The query submittedcan be a search query for “yellow gardenia.” The search tokens for thesearch query are “yellow” and “gardenia.” Although the search tokens areillustrated as single words, a search token could include two or morewords, depending on the query.

To facilitate identification of the search results responsive toqueries, the search engine 112 can index the content provided by thepublishers 106 (e.g., an index of web pages) for later search andretrieval of search results that are relevant to the queries. Anexemplary search engine 112 is described in S. Brin and L. Page, “TheAnatomy of a Large-Scale Hypertextual Search Engine,” SeventhInternational World Wide Web Conference, Brisbane, Australia (1998) andin U.S. Pat. No. 6,285,999. Search results can include, for example,lists of web page titles, snippets of text extracted from those webpages, and hypertext links to those web pages, and may be grouped into apredetermined number (e.g., ten) of search results.

Multiple search queries can be submitted to the search engine 112 in onesearch session. In some implementations, a search session can be definedby a period of time between queries. For example, if a particular userdevice 108 a submits a query, a current search session can be initiated.The current search session can be terminated when the search engine 112has not received further queries from the user for a preset period oftime (e.g., 5-10 minutes). In other implementations, the search sessioncan be defined by a user indicating the beginning and end of a searchsession (e.g., by logging into a search engine interface of the searchengine 112 and logging out of a search engine interface). In stillfurther implementations, the search session can be defined by arelationship between a newly received search query and previouslyreceived search queries from the same user. Other ways of identifyingand tracking a search session can also be used.

Users generally desire that the search queries result in theidentification of search results that are most responsive to a user'sinterest. Often, an initial search query does not produce a searchresult that satisfies a user's interest, as indicated by the usersubmitting more queries targeting the same topic or subject. The initialquery may contain inaccurate search tokens that may include misspelledwords or misused words. Thus the initial query can be followed bysubsequent queries during a search session that includes modified searchtokens in the query, substituted search tokens, removed search tokens inthe query, etc. These modified queries are submitted by the user as theuser attempts to find search results that are more relevant to theuser's interest.

A search token input by the user can be inaccurate given the context ofthe search session. For example, where previous search queries during asearch session include search tokens related to flowers and gardening,the search token “flour,” while spelled correctly, can nevertheless beinaccurate. A search token can also be inaccurate if the search token ismisspelled, e.g., the term “fluer” may be entered instead of the term“fleur.”

§2.0 Contextual Query Revision

In some implementations, the search engine 112 can include a contextualquery processor 104 that can identify potentially inaccurate queries andsuggest contextual modifications to the inaccurate queries. Thecontextual query processor 104 can identify a context of a searchsession from previous queries submitted by a user during the searchsession. The contextual query processor 104 can identify inaccuratesearch tokens in a current search query, and, based on the context ofthe search session in which the current search query is received,identify possible replacement tokens for the inaccurate search tokens.The processor 104 can determine which of the possible replacement tokensis the appropriate replacement token for the inaccurate search tokenbased on the previous search queries submitted in the search session.

FIG. 2 is a block diagram of an example contextual query processingsystem 200. The system 200 can generate a modified query from a searchquery with an inaccurate search token. The modified search query isbased on the context of the search session of the search query. Thecontext of the search session can, for example, be identified fromprevious search queries submitted by a user during a search session. Insome implementations, a current search query in addition to previoussearch queries received during a search session can also be used toidentify a search session context. In some implementations, thecontextual query processing system 200 can include a search interface202, a query analysis module 204, and a replacement term analysis module206. The system 200 may be implemented as part of a search engine, or asa separate component, or as a system that communicates with a searchengine.

The system 200 receives a current search query during a search sessionand identifies potentially inaccurate search tokens from among thesearch tokens that comprise the current search query. The system 200 canthen identify replacement tokens based upon the potentially inaccuratesearch tokens. The system 200 identifies from query logs a group ofrelated tokens that are related to previous search queries in the searchsession by identifying terms related to the previous search tokens inthe previous queries. If an identified replacement token is among therelated tokens, a modified search query can be generated.

In an implementation, the search interface 202 receives a current searchquery associated with a current search session. The current search querycan include one or more current search tokens. For example, a user cansubmit queries searching for a particular type of yellow flower with along stem. The first query submitted can be a search query for “yellowgardenia,” followed by a second search query for “long stemmed fluer.”Thus, the search tokens for the most current search query are “long,”“stemmed,” and “fluer.” The previous search tokens for the previoussearch query are “yellow” and “gardenia.”

For the current search query, potentially inaccurate search tokens areidentified. In some implementations, a potentially inaccurate searchtoken is identified by identifying misspelled tokens. Additionally, insome implementations, a potentially inaccurate search token isidentified by identifying potentially misused tokens. Replacement tokenscan be identified for the potentially inaccurate tokens, and one of thereplacement tokens can be selected based on a context defined by thesearch session for which the current query was received.

§2.1 Misspelled Tokens and Session Context Correction

One method of identifying potentially inaccurate search tokens for acurrent query is to determine when a search token is misspelled. Forexample, in the current query for “long stemmed fluer,” the currentsearch token “fluer” is a misspelled search token. Thus, the module 204identifies the current search token “fluer” as a potentially inaccuratesearch token.

The query analysis module 204 identifies replacement tokens based uponthe potentially inaccurate search token. Although multiple methods maybe available to identify a replacement token for a search token, in oneimplementation the module 204 accesses a set of possible replacementtokens directly from replacement token data 208. The replacement tokenscan be suggested replacements, e.g., spell corrections, for theinaccurate search token. For example, the tokens “flier,” “flower,”“flour,” and “fleur” may be identified as suggested replacements in thereplacement token data 208 for the potentially inaccurate search token“fluer.”

The replacement term analysis module 206 selects a replacement term forthe potentially inaccurate search token. The selection can, for example,be based on context defined by the search session for which the currentquery was received. In some implementations, to determine the contextfor a search session, the module 206 identifies previous queriesreceived during a search session and identifies previous search tokensfrom the previous queries. These previous search tokens can be used toidentify related tokens that are related to the previous search queriessubmitted during the search session. For example, the previous searchtokens for the search session can compared to a query log 210. The querylog 210 stores historical search queries from many other historicalsearch sessions. The replacement term analysis module 206 can thusidentify other search tokens used in similar search queries duringsimilar search sessions as tokens that are related to the previoussearch tokens.

For example, where the previous search tokens for a search session are“yellow” and “gardenia,” the module 206 may identify a group of relatedtokens for both previous search tokens from the query log 210. Data inthe query logs 210 that is gathered from many other sessions mayindicate that tokens commonly associated with “yellow” include “taxi,”“banana,” and “sun.” Similarly, tokens commonly associated with“gardenia” may include “plant,” “leaves,” and “flower.” Thus, the tokens“taxi,” “banana,” and “sun” are identified as related tokens for theprevious search token “yellow.” Likewise, the tokens “plant,” “leaves,”and “flower” are identified as related tokens for the previous searchquery “gardenia.” The module 206 accesses such data and generates groupsof related tokens from the query logs 210.

Once the suggested replacement tokens from the replacement token data208 and the related tokens are identified, the replacement term analysismodule 206 can then determine which replacement tokens for thepotentially incorrect search token is present in the group of relatedtokens, and which replacement tokens among those present is estimated tobe the best replacement token. The module 206 compares the replacementtokens for the potentially inaccurate search token to the group ofrelated tokens identified by the module 206. If the group of relatedtokens includes any of the replacement tokens, the module 206 cangenerate a modified search query to include the replacement token inplace of the potentially inaccurate search token.

For example, the module 204 has identified “fluer” as a misspelled word,and thus it is the only potentially inaccurate search token from thecurrent search query “long stemmed fluer.” The module 204 alsoidentified the words “flier,” “flower,” “flour,” and “fleur” as possiblereplacement tokens, e.g., spelling corrections, for the potentiallyinaccurate token. The group of related tokens identified by the module206 includes the terms “taxi,” “banana,” “sun,” “plant,” “leaves,” and“flower.” The module 206 may thus determine that the replacement token“flower” is among the group of related tokens. Accordingly, the module206 generates a modified query for “long stemmed flower” that takes theplace of the current search query for “long stemmed fluer.”

If the group of related tokens identified by the module 206 includesmore than one possible replacement token, e.g., the terms “taxi,”“banana,” “sun,” “plant,” “leaves,” “flair,” and “flower,” then theselection can, for example, be based on additional context informationdefined by the search session. For example, the tokens of the currentquery of “long stemmed fluer” and previous queries of “yellow gardenia”and “long stemmed bulbs” can be processed to determine a subject weight.For example, each token can have associated weights for varioussubjects, e.g., subjects such as history, gardening, sports, news,entertainment, etc. The weights of the search tokens can be summed foreach subject, and the highest summed weight can indicate a subjectcontext for the search session. As subject weights of the tokens“gardenia,” “stemmed,” and “bulbs” may primarily indicate a gardeningsubject matter, the context of the search session may be determined tobe a gardening context. Accordingly, the token “flower” may be selectedto replace the token “fluer” as the token “flower” may have the highestsubject gardening subject weight among the replacement tokens.

§2.2 Misused Tokens and Session Context Correction

In another implementation, the module 204 can identify a potentiallyinaccurate search token by comparing the current search tokens from thecurrent search query to the previous search tokens from one or moreprevious search queries received during the search session. Through sucha comparison, the module 204 may determine that the sequence of searchqueries in the search session is an attempt to refine the previoussearch query by substituting or adding one or more tokens in the searchquery. Accordingly, the substituted or added search token can beidentified as the potentially inaccurate search token.

For example, if the first search query includes the search tokens “longstemmed bulbs,” a second query includes the search tokens “long stemmedroses” and a current search query includes the search tokens “longstemmed flour,” the sequence of the search queries indicates that theterm “bulbs” was replaced by “flour” in the current search query. Thusthe module 204 may determine that the search token “flour” is apotentially inaccurate search token, even though “flour” is not amisspelled word.

In a variation of this implementation, the tokens of the current queryof “long stemmed flour” and previous queries of “long stemmed bulbs” and“long stemmed roses” can be processed to determine a subject weight. Forexample, each token can have associated weights for various subjects,e.g., subjects such as history, gardening, sports, news, entertainment,etc. The weights of the search tokens can be summed for each subject,and the highest summed weight can indicate a subject context for thesearch session. For example, the summed weights for the tokens“stemmed,” “bulbs” and “roses” may result in the highest weight being inthe gardening subject. Accordingly, the token “flour,” which is thechanged token from a previous query, can be determined to be potentiallyincorrect as the token has very low weight related to the subject ofgardening. Conversely, if the current query is “long stemmed tulips,”the token “tulips” may be determined to be a correct token.

The module 206 can then identify a group of related tokens based on thecontext of the search session, e.g., other tokens that are related toprevious search tokens received during the search session. For example,the previous search tokens for the search session can compared to aquery log 210. The module 206 can then identify a group of relatedtokens based on the previous search tokens. Thus, if the previous searchtoken “bulb” was replaced by the potentially inaccurate token “flour,”the module 206 can identify a group of terms related to the previoussearch token “bulb.” The related tokens could include terms commonlyassociated with “bulb,” e.g., “rose,” “flower.”

The module 204 can then identify the replacement token for thepotentially inaccurate search token from the related tokens identifiedby the module 206. In some implementations, the module 206 can use adistance vector to identify the related token that is most similar tothe potentially inaccurate term. For example, the module 204 can use adistance vector to determine that from a list of related tokens thatincludes “rose” and “flower,” the potentially inaccurate token “flour”is most similar to the related token “flower.” Other similaritytechniques can also be used.

The module 206 can generate a modified search query to include thereplacement token in place of the potentially inaccurate search token.For example, if “flower” is identified as the related token most similarto the potentially inaccurate search token “flour,” then the searchtoken “flour” is replaced in the current search query “long stemmedflour” with the search token “flower.” Thus, the modified search queryis “long stemmed flower.”

In another implementation, possible replacement tokens can be identifiedby identifying token pairs that are commonly confused tokens, e.g.,“principal” and “principle,” “fair” and “fare,” “fair” and “flair,” etc.Such identification of commonly confused token pairs can be determined,for example, using clustering techniques to identify token revisionsthat occur at statistically significant rates, e.g., statisticallyconfused tokens, or based on language models, such as homograph pairs,or other language rules of statistical data. A replacement token canthen be selected from the possible replacement tokens in a mannersimilar to the misspelled token analysis process of Section 2.1 above,e.g., by comparing the possible replacement tokens to the relatedtokens.

The modules 204 and 206 can be realized by instructions that uponexecution cause one or more processing devices to carry out theprocesses and functions described above. Such instructions can, forexample, comprise interpreted instructions, such as script instructions,e.g., JavaScript or ECMAScript instructions, or executable code, orother instructions stored in a computer readable medium. The modules 204and 206 can be implemented separately, or can be implemented as a singlesoftware entity. The modules 204 and 206 can also be distributivelyimplemented over a network, such as a server farm, or can be implementedin a single computer device, or can be implemented as part of the searchengine 112.

§3.0 Example Identification of Related Tokens

FIG. 3 is a diagram identifying related tokens from previous searchqueries 300. The related tokens 320 identified in the diagram 300 can beretrieved from the query logs 210. The related tokens 320 include searchterms that are related to a previous query 324 in the context of asearch session that includes the previous search query 324 and a currentsearch query 325. As will be explained below, the search tokens ST1-ST6are identified as related tokens 320 related to the previous searchquery 324.

In some implementations, the related tokens are the search tokens in atoken cluster that includes the search tokens from the previous searchquery 324. A token cluster can be a group of related tokens that areassociated with each other. The search tokens included in a tokencluster are identified from query logs as tokens that share a commontrait—e.g., are statistically related to each other, such as the token“stemmed” often being found to precede the term “roses” in queries; orthe term “green” often being found to precede the term “giant.” Suchclusters can be identified by, for example, k-means clusteringtechniques, c-means clustering, quality threshold clustering, etc.Although example clusters of only two terms have been described, thetoken clusters can include many more tokens than just two tokens.

In another implementation, search tokens are included in a token clusterif the search token is included in excess of a threshold percentage ofsearch queries containing other search tokens in the token cluster. Forexample, a 50% threshold requires that the search token must be includedin at least half the search queries including at least one of the othersearch tokens in the cluster. The threshold can be set to some valuethat indicates a likelihood that the search tokens are related to eachother.

For example, the data from the historical search queries 310 stored inthe query log 210 is represented in the diagram 300, and includes sixhistorical search queries, e.g. Query 301-Query 306, and the searchtokens that are used in each query, e.g. ST1-ST7. The search token ST1is among the search tokens in four of the six of the historical searchqueries, e.g. Query 301, 302, 304, and 305. Similarly, the inclusion ofthe search tokens ST2-ST7 in the historical search queries is:

Search Token Historical Search Queries % Inclusion ST1: 301, 302, 304,305 4/6 = 67% ST2: 301, 302, 303 3/6 = 50% ST3: 303, 304, 305, 306 4/6 =67% ST4: 302, 305, 306 3/6 = 50% ST5: 301, 303, 306 3/6 = 50% ST6: 303,304, 305, 306 4/6 = 67% ST7: 304 1/6 = 16%

The search token ST7 is included in less than the threshold percentage,e.g. 50%, of search queries involving other search tokens from thecluster. However, the tokens ST1-ST6 are included in the token clusterbecause they all are included in at least 50% of the search queriesinvolving other search tokens in the token cluster. Thus, the group ofrelated tokens 320 includes all of the search tokens in the tokencluster, e.g. search tokens ST1-ST6.

Other token clustering or grouping processes can also be used toidentify related search query tokens.

FIG. 4 depicts example screen shots 406 and 408 of a search engineinterface. The original query 402 submitted to the search engine in theinterface of screen shot 406 can be modified by the system 200 of FIG.2. The search engine can process the modified query 404 in place of theoriginal query 402, and search results responsive to the modified query404 are presented. In some implementations, a link 405 may be providedto search results responsive to the original query before it wasmodified. For example, the original query submitted may have been for“long stemmed flour.” After it is determined that the search token“flour” is inaccurate, replacement search tokens may be identified. Theterm “flower” is identified as a related token as well as a replacementsearch token, and thus the search token “flour” in the original query isreplaced with “flower” in the modified search query. The screen shot 408of the interface also includes the link 405, which would process theoriginal query for “long stemmed flour” rather than the modified queryfor “long stemmed flower.”

§4.0 Example Contextual Revision Processes

FIG. 5 is a flow diagram of a contextual query revision process 500. Theprocess 500 can, for example, be implemented by the system 200 of FIG.2.

Stage 502 receives a current search query during a search session. Forexample, the search interface 202 may receive a query including thesearch tokens “long stemmed flour,” and this query can be provided tothe query analysis module 204. Another example is a search query for“long stemmed fluer.”

Stage 504 identifies a potentially inaccurate search token from amongthe one or more current search tokens. For example, the query analysismodule 204 can identify “fluer” as the potentially inaccurate searchtoken because the term is misspelled. In another example, the module 204can identify “flour” as the potentially inaccurate search token becausefrom the search query for “long stemmed flour” because the previoussearch queries included search tokens related to flowers and gardening,e.g. “long stemmed bulb,” “long stemmed rose,” where the search tokens“long” and “stemmed” remained the same and the last search token wassubstituted each time.

Stage 506 identifies a replacement token based upon the potentiallyinaccurate search token. For example, the module 204 can identifydifferent possible replacement tokens from the replacement token data208 for the potentially inaccurate search token of “fluer,” includingthe replacement tokens “flour,” “flower,” “flier,” and “flurry.” Themodule 204 can also identify the replacement tokens “flower,” “four,”and “fore” as possible replacement tokens from the data 208 for thepotentially inaccurate search token “flour.”

Stage 508 identifies a group of related tokens from a query log. Forexample, the replacement term analysis module 206 can identify a groupof related tokens from the query log 210 that are related to previoussearch queries during the same search session. If “petal” was a searchtoken in a previous search query, the module 206 can identify from thequery log 210 terms that are related to the token “petal.” The relatedtokens could include “bulb,” “rose,” “flower,” etc. If “long stemmedbulb” or “long stemmed rose” was the previous search query, the module206 can identify from the log 210 terms related to the previous searchtokens in the previous search queries. The search token “flower” can beidentified as a term related to both the search token “bulb” and thesearch token “rose.”

Stage 510 determines whether the replacement token for the potentiallyinaccurate search tokens is among the group of related tokens. Forexample, the module 206 determines that one of the replacement tokens,“flower,” is included in the group of related tokens related to thesearch query “long stemmed fluer.” Similarly, the module 206 determinesthat the replacement token “flower” is included among the group ofrelated token related to the search query “long stemmed flour.” If stage510 determines that the replacement token is among the group of relatedtokens, stage 512 modifies the current search query. For example, wherestage 510 determines that the replacement token “flower” is also amongthe related tokens, the potentially inaccurate search token “fluer” isreplaced with the replacement token “flower.” Thus, the current searchquery is modified to “long stemmed flower” instead of “long stemmedfluer.” Similarly, where stage 510 determines that the replacement token“flower” is among the related tokens related to the search query “longstemmed flour,” the potentially inaccurate search token “flour” isreplaced with the replacement token “flower.” Thus, the current searchquery is modified to “long stemmed flower” instead of “long stemmedflour.”

If the replacement token is not among the group of related tokens, orafter the current search query has been modified, stage 514 servesresults associated with the current search query. For example, if stage510 determines that “flower” is among the group of related tokens, thensearch results responsive to a query for “long stemmed flower” areserved. However, if stage 506 determines that “flower” is not areplacement token, or if stage 508 determines that “flower” was not arelated token, then stage 510 would subsequently determine that areplacement token is not among the group of related tokens. Thus, searchresults responsive to a query for “long stemmed flour” would be served.

FIG. 6 is a flow diagram of a contextual query revision process 600. Theprocess 600 can, for example, be implemented by the system 200 of FIG.2.

Stage 602 receives a current search query. For example, the searchinterface 202 may receive a query including the search tokens “longstemmed flour,” and this query can be provided to the query analysismodule 204.

Stage 604 identifies a group of related tokens. The identified group ofrelated tokens can be search tokens related to previous search queriesduring the search session. For example, if “long stem rose” was theprevious search query during the search session, the previous searchtokens are “long,” “stem,” and “rose.” The module 206 can identify fromthe query log 210 the search tokens that are related to the previoussearch tokens in historical search queries, i.e., the different searchtokens submitted with the previous search tokens “long,” “stem” and“rose.” The related tokens could include terms commonly associated with“long”, e.g., “wide,” “heavy,” terms commonly associated with “stem,”e.g. “root,” “leaves,” and terms commonly associated with “rose,” e.g.“yellow,” “flower.”

Stage 606 identifies a current search token from the current searchquery. For example, the query analysis module 204 can parse the currentsearch query “long stemmed flour” and identify the search tokens “long,”“stemmed,” and “flour.”

Stage 608 determines whether the current search token exists in thegroup of related tokens. For example, where the current search token is“flour,” the current search token does not exist in the group of relatedtokens. Thus, where the current search token is “flour,” the replacementterm analysis module 206 would determine that the current search tokenis not found in the related tokens.

If stage 608 determines that the current search token exists in thegroup of related tokens, stage 610 serves results associated with thecurrent search query. For example, if stage 608 determines that thetoken “flour” existed in the related tokens, then stage 610 servesresults responsive to the search query “long stemmed flour.” If thecurrent search token does not exist in the group of related tokens,stage 612 identifies a potential replacement token based upon thecurrent search token. The replacement token is a member of the group ofrelated tokens. For example, if stage 608 determines that “flour” doesnot exist in the related tokens, module 204 identifies from thereplacement token data 208 potential replacement tokens based upon thecurrent search token of “flour.” The tokens “flower,” “flier,” and“four” may be included in the replacement token data 208 as potentialreplacement tokens based for “flour.” Because “flower” is both apotential replacement token and a member of the related tokens, “flower”is identified by the module 206 as the replacement token.

Stage 614 generates a modified search query comprising the replacementtoken. For example, module 206 generates the modified query “longstemmed flower” where “flower” is identified as the replacement tokenfor “flour.”

Embodiments of the subject matter and the functional operationsdescribed in this specification can be implemented in digital electroniccircuitry, or in computer software, firmware, or hardware, including thestructures disclosed in this specification and their structuralequivalents, or in combinations of one or more of them. Embodiments ofthe subject matter described in this specification can be implemented asone or more computer program products, i.e., one or more modules ofcomputer program instructions encoded on a tangible program carrier forexecution by, or to control the operation of, data processing apparatus.The tangible program carrier can be a propagated signal or a computerreadable medium. The propagated signal is an artificially generatedsignal, e.g., a machine generated electrical, optical, orelectromagnetic signal, that is generated to encode information fortransmission to suitable receiver apparatus for execution by a computer.The computer readable medium can be a machine readable storage device, amachine readable storage substrate, a memory device, a composition ofmatter effecting a machine readable propagated signal, or a combinationof one or more of them.

The term “data processing apparatus” encompasses all apparatus, devices,and machines for processing data, including by way of example aprogrammable processor, a computer, or multiple processors or computers.The apparatus can include, in addition to hardware, code that creates anexecution environment for the computer program in question, e.g., codethat constitutes processor firmware, a protocol stack, a databasemanagement system, an operating system, or a combination of one or moreof them.

A computer program (also known as a program, software, softwareapplication, script, or code) can be written in any form of programminglanguage, including compiled or interpreted languages, or declarative orprocedural languages, and it can be deployed in any form, including as astand alone program or as a module, component, subroutine, or other unitsuitable for use in a computing environment. A computer program does notnecessarily correspond to a file in a file system. A program can bestored in a portion of a file that holds other programs or data (e.g.,one or more scripts stored in a markup language document), in a singlefile dedicated to the program in question, or in multiple coordinatedfiles (e.g., files that store one or more modules, sub programs, orportions of code). A computer program can be deployed to be executed onone computer or on multiple computers that are located at one site ordistributed across multiple sites and interconnected by a communicationnetwork.

Additionally, the logic flows and structure block diagrams described inthis patent document, which describe particular methods and/orcorresponding acts in support of steps and corresponding functions insupport of disclosed structural means, may also be utilized to implementcorresponding software structures and algorithms, and equivalentsthereof. The processes and logic flows described in this specificationcan be performed by one or more programmable processors executing one ormore computer programs to perform functions by operating on input dataand generating output. The processes and logic flows can also beperformed by, and apparatus can also be implemented as, special purposelogic circuitry, e.g., an FPGA (field programmable gate array) or anASIC (application specific integrated circuit).

Processors suitable for the execution of a computer program include, byway of example, both general and special purpose microprocessors, andany one or more processors of any kind of digital computer. Generally, aprocessor will receive instructions and data from a read only memory ora random access memory or both. The essential elements of a computer area processor for performing instructions and one or more memory devicesfor storing instructions and data. Generally, a computer will alsoinclude, or be operatively coupled to receive data from or transfer datato, or both, one or more mass storage devices for storing data, e.g.,magnetic, magneto optical disks, or optical disks. However, a computerneed not have such devices. Moreover, a computer can be embedded inanother device, e.g., a mobile telephone, a personal digital assistant(PDA), a mobile audio or video player, a game console, a GlobalPositioning System (GPS) receiver, to name just a few.

Computer readable media suitable for storing computer programinstructions and data include all forms of non volatile memory, mediaand memory devices, including by way of example semiconductor memorydevices, e.g., EPROM, EEPROM, and flash memory devices; magnetic disks,e.g., internal hard disks or removable disks; magneto optical disks; andCD ROM and DVD ROM disks. The processor and the memory can besupplemented by, or incorporated in, special purpose logic circuitry.

To provide for interaction with a user, embodiments of the subjectmatter described in this specification can be implemented on a computerhaving a display device, e.g., a CRT (cathode ray tube) or LCD (liquidcrystal display) monitor, for displaying information to the user and akeyboard and a pointing device, e.g., a mouse or a trackball, by whichthe user can provide input to the computer. Other kinds of devices canbe used to provide for interaction with a user as well; for example,feedback provided to the user can be any form of sensory feedback, e.g.,visual feedback, auditory feedback, or tactile feedback; and input fromthe user can be received in any form, including acoustic, speech, ortactile input.

Embodiments of the subject matter described in this specification can beimplemented in a computing system that includes a back end component,e.g., as a data server, or that includes a middleware component, e.g.,an application server, or that includes a front end component, e.g., aclient computer having a graphical user interface or a Web browserthrough which a user can interact with an implementation of the subjectmatter described is this specification, or any combination of one ormore such back end, middleware, or front end components. The componentsof the system can be interconnected by any form or medium of digitaldata communication, e.g., a communication network. Examples ofcommunication networks include a local area network (“LAN”) and a widearea network (“WAN”), e.g., the Internet.

The computing system can include clients and servers. A client andserver are generally remote from each other and typically interactthrough a communication network. The relationship of client and serverarises by virtue of computer programs running on the respectivecomputers and having a client server relationship to each other.

While this specification contains many specific implementation details,these should not be construed as limitations on the scope of anyinvention or of what may be claimed, but rather as descriptions offeatures that may be specific to particular embodiments of particularinventions. Certain features that are described in this specification inthe context of separate embodiments can also be implemented incombination in a single embodiment. Conversely, various features thatare described in the context of a single embodiment can also beimplemented in multiple embodiments separately or in any suitablesubcombination. Moreover, although features may be described above asacting in certain combinations and even initially claimed as such, oneor more features from a claimed combination can in some cases be excisedfrom the combination, and the claimed combination may be directed to asubcombination or variation of a subcombination.

Similarly, while operations are depicted in the drawings in a particularorder, this should not be understood as requiring that such operationsbe performed in the particular order shown or in sequential order, orthat all illustrated operations be performed, to achieve desirableresults. In certain circumstances, multitasking and parallel processingmay be advantageous. Moreover, the separation of various systemcomponents in the embodiments described above should not be understoodas requiring such separation in all embodiments, and it should beunderstood that the described program components and systems cangenerally be integrated together in a single software product orpackaged into multiple software products.

Particular embodiments of the subject matter described in thisspecification have been described. Other embodiments are within thescope of the following claims. For example, the actions recited in theclaims can be performed in a different order and still achieve desirableresults. As one example, the processes depicted in the accompanyingfigures do not necessarily require the particular order shown, orsequential order, to achieve desirable results. In certainimplementations, multitasking and parallel processing may beadvantageous.

1. (canceled)
 2. A method, comprising: receiving, by one or morecomputers, a current search query during a current search session;determining, by one or more computers and based on a difference betweenterms of the current search query and terms of a previous search queryreceived during the current search session, that the current searchquery is an attempt to refine the previous search query; identifying, byone or more computers and based on the determination that the currentsearch query is an attempt to refine the previous search query, a set ofrelated terms based on a given term that is included in the previoussearch query, but not included in the current search query; determining,by one or more computers and based on search log data for previoussearch sessions, that the given term was replaced with a different termfrom the set of related terms in at least a specified portion of theprevious search sessions; in response to the determination that thegiven term was replaced with the different term from the set of relatedterms, generating a modified search query that includes the differentterm; and providing the modified search query for presentation in adisplay of a user device corresponding to the current search session. 3.The method of claim 2, further comprising determining that a particularterm in the current search query is a potentially inaccurate term. 4.The method of claim 3, wherein: determining that the particular term inthe current search query is a potentially inaccurate term comprisesdetermining that the particular term has been replaced with another termby other users in previous search sessions; and generating a modifiedsearch query comprises replacing the particular term with the differentterm.
 5. The method of claim 3, wherein: determining that the particularterm in the current search query is a potentially inaccurate termcomprises determining that the particular term is included in a set ofmisspelled terms; and generating a modified search query comprisesreplacing the particular term with the different term.
 6. The method ofclaim 5, further comprising: comparing the set of misspelled terms tothe set of related terms; and determining, based on the comparing, thata matching term is included in each of the set of related terms and theset of misspelled terms, wherein: generating a modified search querycomprises replacing the particular term with the matching term.
 7. Themethod of claim 3, wherein determining that a particular term in thecurrent search query is a potentially inaccurate term comprises:determining a subject context for the current search session based onsubjects of queries submitted during the current search session; anddetermining that the particular term has less than a specified level ofsimilarity to the subject context.
 8. The method of claim 2, whereinidentifying a set of related tokens comprises selecting, as the set ofrelated tokens, tokens that have at least a specified level ofsimilarity to the subject context of the current search session.
 9. Themethod of claim 2, further comprising obtaining search results based onthe modified search query.
 10. A system comprising: one or more datastores storing a query log that includes search queries for a pluralityof different search sessions; and data processing apparatus includingone or more processors executing instructions that cause the one or moreprocessors to interact with the data store and to perform actionsincluding: receiving a current search query during a current searchsession; determining, based on a difference between terms of the currentsearch query and terms of a previous search query received during thecurrent search session, that the current search query is an attempt torefine the previous search query; identifying, based on thedetermination that the current search query is an attempt to refine theprevious search query, a set of related terms based on a given term thatis included in the previous search query, but not included in thecurrent search query; determining, based on search log data for previoussearch sessions, that the given term was replaced with a different termfrom the set of related terms in at least a specified portion of theprevious search sessions; in response to the determination that thegiven term was replaced with the different term from the set of relatedterms, generating a modified search query that includes the differentterm; and providing the modified search query for presentation in adisplay of a user device corresponding to the current search session.11. The system of claim 10, wherein the instructions cause the one ormore data processing apparatus to perform operations further comprisingdetermining that a particular term in the current search query is apotentially inaccurate term.
 12. The system of claim 11, wherein:determining that the particular term in the current search query is apotentially inaccurate term comprises determining that the particularterm has been replaced with another term by other users in previoussearch sessions; and generating a modified search query comprisesreplacing the particular term with the different term.
 13. The system ofclaim 11, wherein: determining that the particular term in the currentsearch query is a potentially inaccurate term comprises determining thatthe particular term is included in a set of misspelled terms; andgenerating a modified search query comprises replacing the particularterm with the different term.
 14. The system of claim 13, wherein theinstructions cause the one or more data processing apparatus to performoperations further comprising: comparing the set of misspelled terms tothe set of related terms; and determining, based on the comparing, thata matching term is included in each of the set of related terms and theset of misspelled terms, wherein: generating a modified search querycomprises replacing the particular term with the matching term.
 15. Thesystem of claim 11, wherein determining that a particular term in thecurrent search query is a potentially inaccurate term comprises:determining a subject context for the current search session based onsubjects of queries submitted during the current search session; anddetermining that the particular term has less than a specified level ofsimilarity to the subject context.
 16. The system of claim 10, whereinidentifying a set of related tokens comprises selecting, as the set ofrelated tokens, tokens that have at least a specified level ofsimilarity to the subject context of the current search session.
 17. Thesystem of claim 10, wherein the instructions cause the one or more dataprocessing apparatus to perform operations comprising obtaining searchresults based on the modified search query.